<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style type="text/css">
        .selectDiv{

            background-color: red;
        }
    </style>
</head>
<body style="background-color: #FFFFFF;position: absolute">
<div id="objectSelect" class="aui-margin-l-5 aui-margin-t-10" style="height: 3.4rem;width:100%">

</div>

</body>
<script id="confirm_finsh_ws" type="text/template">

    {{
    for(var i=0;i<it.length;i++){
    var item = it[i];
    }}
    {{? item.dealState=="2"}}
    <div style="margin-bottom: 1rem;border:1px solid grey" onclick="selectFunc(this)" data-userId="{{=item.dealMan}}" data-userName="{{=item.parentProid}}" data-dealDate="{{=item.dealDate}}">
        <span>反馈人:{{=item.parentProid||''}}</span></br>
        <span>反馈时间:{{=item.dealDate||''}}</span>
    </div>
    {{??}}
    <div style="margin-bottom: 1rem;border:1px solid grey;background-color: lightgrey" onclick="notOverWorksheet()" data-userId="{{=item.dealMan}}" data-userName="{{=item.parentProid}}" data-dealDate="{{=item.dealDate}}">
        <span>反馈人:{{=item.parentProid||''}}(未反馈)</span></br>
        <span>反馈时间:{{=item.dealDate||''}}</span>
    </div>
    {{?}}
    {{
    }
    }}
    <div class="" style="margin-left: 80%;bottom: 10px;display: block;width:1rem;height:1rem;margin-top:0.75rem"><input type="button" class="aui-btn" onclick="closeFrame()" value="取消"></div>
</script>
<script>
    apiready = function(){
        var param = api.pageParam
        $api.html($api.byId('objectSelect'),'');
        var conTmpl = doT.template($api.text($api.byId('confirm_finsh_ws')))
        $api.html($api.byId('objectSelect'),conTmpl(param.objectParams));
    }
    function closeFrame(){
        api.closeFrame();
    }
    function selectFunc(ele){
        var clsFlag = $api.hasCls(ele);
        if(clsFlag){
            $api.removeCls(ele,'selectDiv');
        }else{
            $api.addCls(ele,'selectDiv');
        }
        var userId = $api.attr(ele, 'data-userId');
        var userName = $api.attr(ele, 'data-userName');
        var dealDate = $api.attr(ele, 'data-dealDate');
        setTimeout(function(){
            api.closeFrame({});
        },3*100)
        api.sendEvent({
            name: 'closeSelectFrame',
            extra: {userId: userId,userName:userName,dealDate:dealDate}
        });
    }

    function notOverWorksheet(){
        api.toast({
            msg: '该反馈人未返单',
            duration: 2000,
            location: 'middle'
        });
    }
</script>
<script type="text/javascript" src="../../script/api.js"></script>
<script type="text/javascript" src="../../script/config.js"></script>
<script type="text/javascript" src="../../script/common.js"></script>
<script type="text/javascript" src="../../script/doT.min.js"></script>
</html>

